layui.config({
    base: $config.resUrl+'other/'//定义基目录
}).extend({
    ajaxExtention:'js/ajaxExtention',//加载自定义扩展，每个业务js都需要加载这个ajax扩展
    $tool:'js/tool',
    $api:'js/api'
}).use(['element','form','layer','laydate','ajaxExtention','$tool','$api'], function() {
	var $ = layui.jquery, 
	element = layui.element,
	laydate = layui.laydate,
	dtree = layui.dtree,
	form = layui.form,
	layer = layui.layer,
	$tool = layui.$tool,
    $api = layui.$api;
	
	//角色基本信息界面
	$api.RoleDetails({id:$("#id").val()},function(data){
		$("[name=id]").val(data.data.id);
		$("[name=name]").val(data.data.name);
		$("[name=remark]").val(data.data.remark);
		$("[name=operator]").val(data.data.operator);
		$("[name=operateTime]").val($tool.getMyDate(data.data.operateTime));
		//状态下拉框动态赋值
		var status = 'dd[lay-value=' + data.data.status + ']';
		$("[name=status]").siblings("div.layui-form-select").find('dl').find(status).click();
		//状态下拉框动态赋值
		var type = 'dd[lay-value=' + data.data.type + ']';
		$("[name=type]").siblings("div.layui-form-select").find('dl').find(type).click();
		//重新渲染下拉框
		layui.form.render("select");
	});
});
